package cn.stylefeng.guns.modular.forecastElectricityInformation.controller;

import cn.stylefeng.guns.modular.forecastElectricityInformation.entity.QyuanPowerSdDayAheadClearedTotalEnergy;
import cn.stylefeng.guns.modular.forecastElectricityInformation.pojo.request.QyuanPowerSdDayAheadClearedTotalEnergyRequest;
import cn.stylefeng.guns.modular.forecastElectricityInformation.service.QyuanPowerSdDayAheadClearedTotalEnergyService;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 日前出清电量控制器
 *
 * @author 我是谭先生🐻
 * @date 2025/03/14 16:23
 */
@RestController
@ApiResource(name = "日前出清电量")
public class QyuanPowerSdDayAheadClearedTotalEnergyController {

    @Resource
    private QyuanPowerSdDayAheadClearedTotalEnergyService qyuanPowerSdDayAheadClearedTotalEnergyService;

    /**
     * 添加
     *
     * @author 我是谭先生🐻
     * @date 2025/03/14 16:23
     */
    @PostResource(name = "添加", path = "/qyuanPowerSdDayAheadClearedTotalEnergy/add")
    public ResponseData<QyuanPowerSdDayAheadClearedTotalEnergy> add(@RequestBody @Validated(QyuanPowerSdDayAheadClearedTotalEnergyRequest.add.class) QyuanPowerSdDayAheadClearedTotalEnergyRequest qyuanPowerSdDayAheadClearedTotalEnergyRequest) {
        qyuanPowerSdDayAheadClearedTotalEnergyService.add(qyuanPowerSdDayAheadClearedTotalEnergyRequest);
        return new SuccessResponseData<>();
    }

    /**
     * 删除
     *
     * @author 我是谭先生🐻
     * @date 2025/03/14 16:23
     */
    @PostResource(name = "删除", path = "/qyuanPowerSdDayAheadClearedTotalEnergy/delete")
    public ResponseData<?> delete(@RequestBody @Validated(QyuanPowerSdDayAheadClearedTotalEnergyRequest.delete.class) QyuanPowerSdDayAheadClearedTotalEnergyRequest qyuanPowerSdDayAheadClearedTotalEnergyRequest) {
        qyuanPowerSdDayAheadClearedTotalEnergyService.del(qyuanPowerSdDayAheadClearedTotalEnergyRequest);
        return new SuccessResponseData<>();
    }

    /**
     * 编辑
     *
     * @author 我是谭先生🐻
     * @date 2025/03/14 16:23
     */
    @PostResource(name = "编辑", path = "/qyuanPowerSdDayAheadClearedTotalEnergy/edit")
    public ResponseData<?> edit(@RequestBody @Validated(QyuanPowerSdDayAheadClearedTotalEnergyRequest.edit.class) QyuanPowerSdDayAheadClearedTotalEnergyRequest qyuanPowerSdDayAheadClearedTotalEnergyRequest) {
        qyuanPowerSdDayAheadClearedTotalEnergyService.edit(qyuanPowerSdDayAheadClearedTotalEnergyRequest);
        return new SuccessResponseData<>();
    }

    /**
     * 查看详情
     *
     * @author 我是谭先生🐻
     * @date 2025/03/14 16:23
     */
    @GetResource(name = "查看详情", path = "/qyuanPowerSdDayAheadClearedTotalEnergy/detail")
    public ResponseData<QyuanPowerSdDayAheadClearedTotalEnergy> detail(@Validated(QyuanPowerSdDayAheadClearedTotalEnergyRequest.detail.class) QyuanPowerSdDayAheadClearedTotalEnergyRequest qyuanPowerSdDayAheadClearedTotalEnergyRequest) {
        return new SuccessResponseData<>(qyuanPowerSdDayAheadClearedTotalEnergyService.detail(qyuanPowerSdDayAheadClearedTotalEnergyRequest));
    }

    /**
     * 获取列表
     *
     * @author 我是谭先生🐻
     * @date 2025/03/14 16:23
     */
    @GetResource(name = "获取列表", path = "/qyuanPowerSdDayAheadClearedTotalEnergy/list")
    public ResponseData<List<QyuanPowerSdDayAheadClearedTotalEnergy>> list(QyuanPowerSdDayAheadClearedTotalEnergyRequest qyuanPowerSdDayAheadClearedTotalEnergyRequest) {
        return new SuccessResponseData<>(qyuanPowerSdDayAheadClearedTotalEnergyService.findList(qyuanPowerSdDayAheadClearedTotalEnergyRequest));
    }

    /**
     * 获取列表（带分页）
     *
     * @author 我是谭先生🐻
     * @date 2025/03/14 16:23
     */
    @GetResource(name = "分页查询", path = "/qyuanPowerSdDayAheadClearedTotalEnergy/page")
    public ResponseData<PageResult<QyuanPowerSdDayAheadClearedTotalEnergy>> page(QyuanPowerSdDayAheadClearedTotalEnergyRequest qyuanPowerSdDayAheadClearedTotalEnergyRequest) {
        return new SuccessResponseData<>(qyuanPowerSdDayAheadClearedTotalEnergyService.findPage(qyuanPowerSdDayAheadClearedTotalEnergyRequest));
    }

}
